package party 

import (
        _ "github.com/bmizerany/pq"
        "database/sql"
        "fmt"
)

func Getchris() {
        type Person struct {
                partyid int
                first string
                last string
        }

        db, _ := sql.Open("postgres", "user=harper dbname=harper password=sailboat sslmode=disable")

        defer db.Close()
        row := db.QueryRow("select partyid, first, last from person limit 1;")
        person := new(Person)
        row.Scan(&person.partyid, &person.first, &person.last)
        fmt.Print(person.partyid)
        fmt.Print(", " + person.first + ", " + person.last + "\n")
        fmt.Println("from the package!")
}

func Insertparty() int {
	var err = errors.New("sql: insert failed")
	db, err := sql.Open("postgres", "user=harper dbname=harper password=sailboat sslmode=disable")
	defer db.Close()
	partyid, err = db.Exec("insert into party default values;") 
	return partyid
}	
